package com.etc.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.etc.entity.Users;
import com.etc.service.UsersService;

@RestController
public class UsersController {
	// 调用service
	@Autowired
	private UsersService service;

	@GetMapping(value = "users/{userid}")
	public Users getById(@PathVariable("userid") int userid) {

		return service.getUsersById(userid);
	}

}
